
#include<bits/stdc++.h>
using namespace std;
int n;
int my_min = 1, my_max = 1e9;

int main()
{
	cin >> n;
	for(int i=1; i<=n; i++)
	{
		int a, b;
		cin >> a >> b;
		my_max = min(my_max, a / b);
		my_min = max(my_min, a / (b+1)+1);
	}
	cout << my_min << " " << my_max << endl;
	return 0;
}